﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Wechat.Util.Paged
{
    /// <summary>
    /// 封装分页存储过程-查询条件相关信息的类
    /// </summary>
    public class PageCriteria
    {
        public PageCriteria()
        {
            Fields = "*";
            PrimaryKey = "ID";
            CurrentPage = 1;
            PageSize = 10;
        }

        /// <summary>
        /// 表名
        /// 多表是请使用 tA a inner join tB b On a.AID = b.AID
        /// </summary>
        public string TableName { get; set; }

        /// <summary>
        /// 查询字段字符串 如：字段1,字段2
        /// </summary>
        public string Fields { get; set; }

        /// <summary>
        /// 主键
        /// 可以带表头 a.AID
        /// </summary>
        public string PrimaryKey { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int CurrentPage { get; set; }

        /// <summary>
        /// 每页行数
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// where条件
        /// </summary>
        public string Condition { get; set; }

        /// <summary>
        /// order排序
        /// </summary>
        public string Sort { get; set; }
    }
}
